package cn.ml.mybatisdemo.entity;

import java.util.List;

public class Person {
    private int id;
    private String name;
    private String sex;
    private Point point;
    private List<Fen> fens;

    public Person(String name, String sex) {
        this.name = name;
        this.sex = sex;
    }

    public static class Point{
        private int x;
        private int y;

        @Override
        public String toString() {
            return "("+x+","+y+")";
        }

        public int getX() {
            return x;
        }

        public void setX(int x) {
            this.x = x;
        }

        public int getY() {
            return y;
        }

        public void setY(int y) {
            this.y = y;
        }
    }

    public Person() {
    }

    public Person(int id, String name, String sex) {
        this.id = id;
        this.name = name;
        this.sex = sex;
    }

    public Person(int id, String name, String sex, Point point) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.point = point;
    }

    @Override
    public String toString() {
        String line= "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", point=" + point +
                '}';
        if(fens != null){
            for(Fen f:fens){
                line += "("+f.getScore()+","+f.getKename()+")";
            }
        }
        return line;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Point getPoint() {
        return point;
    }

    public void setPoint(Point point) {
        this.point = point;
    }
}
